#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    int n, box = 0;
    cin >> n;
    while (n != 50) {
      if (n > 50) {
        n = n - 3;
        box++;
      } else {
        n = n + 2;
        box++;
      }
    }
    cout << box << endl;
  }
  return 0;
}